<!DOCTYPE HTML>
<html>
<head>
    {include file="common_header"}
    <title>菜单栏目添加</title>
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal"  method="post" enctype="multipart/form-data" action="{:url('add')}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-xs-offset-1"><span class="c-red">*</span>菜单类型：</label>
            <div class="formControls col-xs-6"> <span class="select-box">
				<select name="menu_id" class="select" datatype="*" nullmsg="请选择菜单" onchange="selectmenu($(this))">
					<option value="" selected disabled>请选择菜单</option>
					<option value="0">顶级菜单</option>
                    {volist name="list" id="v"}
                        <option value="{$v['id']}"     {if condition="$v['menu_id'] neq 0"} disabled {/if}>{$v['title']}</option>
                    {/volist}
				</select>
				</span> </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-xs-offset-1"><span class="c-red">*</span>菜单名称：</label>
            <div class="formControls col-xs-6">
                <input type="text" class="input-text" value="{$data['title']}" placeholder="请输入菜单名称" id="name" name="title" datatype="*" nullmsg="请输入菜单名称">
            </div>
        </div>

        <div class="row cl" id="link">
            <label class="form-label col-xs-3 col-xs-offset-1"><span class="c-red">*</span>方法名称：</label>
            <div class="formControls col-xs-6">
                <input type="text" class="input-text" value="{$data['link']}" placeholder="请输入方法名称"  name="link">
            </div>
        </div>
        <div class="row cl" id="icon">
            <label class="form-label col-xs-3 col-xs-offset-1"><span class="c-red"></span>图标：</label>
            <div class="formControls col-xs-6">
                <input type="text" class="input-text" value="{$data['icon']}" name="icon" placeholder="请输入图标代码"  >
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3 col-xs-offset-1"><span class="c-red">*</span>栏目排序：</label>
            <div class="formControls col-xs-6 col-sm-9">
                <input type="text" class="input-text" onkeyup="this.value=this.value.replace(/\D/g,'')" value="{$data['sort']}" placeholder="请输入栏目排序"  name="sort" datatype="n" nullmsg="请填写栏目排序">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label  col-xs-3 col-sm-3 col-xs-offset-1">备注：</label>
            <div class="formControls col-xs-6 col-sm-9">
                <textarea name="content" cols="" rows="" class="textarea"  placeholder="说点什么...100个字符以内" dragonfly="true" >{$data['content']}</textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
{include file="common_footer"}
<!--/_footer 作为公共模版分离出去-->
</body>
<script>
    function selectmenu(obj) {
        $val=obj.val();
        if($val=="" || $val==0){
              $('#link').hide();
              $('#icon').show();
        }else{
            $('#link').show();
            $('#icon').hide();
        }
    }
</script>
</html>